An inspection device of this type has been widely used for inspection of cracks of objects contained in a package, inspection of any foreign substance mixed in contents, and missing part inspection of soup and filling contained in a package of, for example, an instant meal, and is used nowadays to inspect the number of contents. For example, the inspection targets of an inspection device disclosed in Patent Literature 1 are cookies, biscuits, or other items that are arranged in line and contained in a package. This inspection device extracts a region of contents in an X-ray transmission image and extracts, from this extracted region, protrusions in a direction orthogonal to a direction in which the contents are arrayed, specifically, protrusions formed on, for example, a periphery of cookies. The inspection device then counts the number of the contents based on the number of the protrusions.
An inspection device disclosed in Patent Literature 2 separates a single layer of a plurality of objects boxed in touch with each other into individual objects on an X-ray transmission image, and counts the number of contained objects based on the number of the separated objects.